// Entity
package com.lingnan.entity.po;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class ChatMessage {
    private Long id;
    private Long sessionId;
    private Long senderId;
    private Long receiverId;
    private Integer senderType;
    private Integer receiverType;
    private String content;
    private String fileUrl;
    private Integer msgType;
    private Boolean isRead = false;
    private Boolean isWithdrawn = false; // 新增字段 是否已撤回
    private Date createdAt;

    public String toString() {
        if (Boolean.TRUE.equals(isWithdrawn)) {
            return "[该消息已被撤回]";
        }
        return this.content;
    }
}